/**
 * jims
 */
package com.jims.master.modules.blood.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jims.master.common.persistence.DataEntity;

/**
 * 申请用血量表Entity
 * @author CTQ
 * @version 2017-04-10
 */
public class BloodCapacity extends DataEntity<BloodCapacity> {
	
	private static final long serialVersionUID = 1L;
	private String applyId;		// 申请主表ID
	private String fastSlow;		// 用血安排,1:急诊，2：计划，3：备血
	private Date transDate;		// 预定输血时间
	private Double transCapacity;		// 输血量
	private String componentId;		// 申请成份血
	private String unit;		// 血液单位
	private BloodApply bloodApply;
	private BloodComponent bloodComponent;
	public BloodCapacity() {
		super();
	}

	public BloodCapacity(String id){
		super(id);
	}

	@Length(min=1, max=64, message="申请主表ID长度必须介于 1 和 64 之间")
	public String getApplyId() {
		return applyId;
	}

	public void setApplyId(String applyId) {
		this.applyId = applyId;
	}
	
	@Length(min=1, max=1, message="用血安排,1:急诊，2：计划，3：备血长度必须介于 1 和 1 之间")
	public String getFastSlow() {
		return fastSlow;
	}

	public void setFastSlow(String fastSlow) {
		this.fastSlow = fastSlow;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getTransDate() {
		return transDate;
	}

	public void setTransDate(Date transDate) {
		this.transDate = transDate;
	}
	
	@NotNull(message="输血量不能为空")
	public Double getTransCapacity() {
		return transCapacity;
	}

	public void setTransCapacity(Double transCapacity) {
		this.transCapacity = transCapacity;
	}
	
	@Length(min=1, max=64, message="申请成份血长度必须介于 1 和 64 之间")
	public String getComponentId() {
		return componentId;
	}

	public void setComponentId(String componentId) {
		this.componentId = componentId;
	}
	
	@Length(min=0, max=2, message="血液单位长度必须介于 0 和 2 之间")
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public BloodApply getBloodApply() {
		return bloodApply;
	}

	public void setBloodApply(BloodApply bloodApply) {
		this.bloodApply = bloodApply;
	}

	public BloodComponent getBloodComponent() {
		return bloodComponent;
	}

	public void setBloodComponent(BloodComponent bloodComponent) {
		this.bloodComponent = bloodComponent;
	}
}